cmake_minimum_required(VERSION 3.30)
project(logsystem)

set(CMAKE_CXX_STANDARD 17)

add_executable(logsystem main.cpp Logger.h)

# Force source files to be treated as UTF-8 and stdout/stderr to be UTF-8 on MSVC
if(MSVC)
    target_compile_options(logsystem PRIVATE /utf-8)
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
else()
    # For GCC/Clang on Windows or Unix, ensure execution charset is UTF-8
    target_compile_options(logsystem PRIVATE -finput-charset=UTF-8 -fexec-charset=UTF-8)
endif()
